/*
 * @Author: 码农 2646995216@qq.com
 * @Date: 2025-02-20 23:40:26
 * @LastEditors: 码农 2646995216@qq.com
 * @LastEditTime: 2025-02-20 23:40:27
 * @FilePath: /shm/shm_client.cpp
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include"comm.hpp"

int main()
{
	//获得key值
	key_t key=GetShmKey();
    cout<<"key:"<<key<<endl;
    
	//获得shimd值
	int shmid=CreateShmid(key,SIZE);
    cout<<"shimid:"<<shmid<<endl;

	//将内存池与地址空间挂接
	char* shmaddr=(char*)GetShmaddr(shmid);
	cout<<"shmaddr success"<<endl;

	//取消挂接
	ShmDel(shmaddr);
	return 0;
}